import { MCommonTipPage } from "../common/MCommonTipPage";
import { TipContentObj } from "../obj/GlobalObj";
import { SceneMgr } from "../SceneMgr";


export class MGoodsTipPage {

    private static _ins: MGoodsTipPage;
    static get Ins(): MGoodsTipPage {
        return this._ins ||= new MGoodsTipPage();
    }


    /**
     * @param tipObj 文字内容，可以多行，单行不同颜色
     * @param leftHandler 
     * @param rightHandler 
     * @param parent 
     */
    public open(tipObj: TipContentObj|TipContentObj[], leftHandler: Laya.Handler, rightHandler: Laya.Handler,iconUrl:string,parent?:any) {
        MCommonTipPage.initTipObj(tipObj);
        SceneMgr.autoCreateView(SceneMgr.GoodsTipPage, parent, [tipObj, leftHandler, rightHandler, iconUrl]);
    }


    public close() {
        SceneMgr.autoCloseView(SceneMgr.GoodsTipPage);
    }
}
